package com.example.receiptocr.api

import com.example.receiptocr.bodys.requestBodys.ReceiptResultBody
import com.example.receiptocr.bodys.responseBodys.BackReceipt
import com.example.receiptocr.bodys.responseBodys.ReceiptInfo
import com.example.receiptocr.viewModels.WeeklyExpenseData

import retrofit2.http.GET
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Body
import retrofit2.Response

interface ReceiptApi {
    @GET("api/receipts/recent")
    suspend fun getRecentReceipts(): List<ReceiptInfo>

    @GET("api/receipts/weekly-expenses")
    suspend fun getWeeklyExpenses(
    ): List<WeeklyExpenseData>

    @GET("api/receipts/{id}")
    suspend fun getReceiptById(@Path("id") id: Long): Response<ReceiptInfo>
    
    @PUT("api/receipts/update")
    suspend fun updateReceipt(
        @Body receipt: ReceiptInfo
    ): Response<ReceiptInfo>

    @PUT("api/receipt/add")
    suspend fun addReceipt(
        @Body backReceipt: BackReceipt
    ): Response<ReceiptInfo>
}
